<!--
 * @FilePath     : /study_code/jquery/ajax-options-complete.html
 * @Description  : $.ajax({ complete: f() })
 * @Date         : 2025-04-17 14:36:06
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-17 14:43:48
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <!-- <link rel="stylesheet" href="" /> -->
  </head>
  <body>
    <div id="demo-test">jq基础模板</div>

    <script src="/jquery/dist/jquery.min.js"></script>
    <script src="/jquery/ajax/common.js"></script>
    <script>
      $.ajax({
        url: baseUrl.root + baseUrl.ajax + '/',
        type: 'GET',
        success: function (res) {
          console.log(1, '请求成功', res)
        },
        error: function (err) {
          console.log(2, '请求失败', err)
        },
        complete: function (xhr, status) {
          console.log(3, '请求后', xhr)
          console.log(4, '请求后', status) // 4 '请求后' 'success'
        },
      })

      $.ajax({
        url: baseUrl.root + baseUrl.ajax + '/xsl',
        type: 'GET',
        success: function (res) {
          console.log(11, '请求成功', res)
        },
        error: function (err) {
          console.log(22, '请求失败', err)
        },
        complete: function (xhr, status) {
          console.log(33, '请求后', xhr)
          console.log(44, '请求后', status) // 44 '请求后' 'error'
        },
      })
    </script>
  </body>
</html>
